package com.itheima.advantagesup.mapper;

import com.github.pagehelper.Page;
import com.itheima.advantagesup.dto.AdvImgCreateDTO;
import com.itheima.advantagesup.dto.AdvImgUpdateDTO;
import com.itheima.advantagesup.entity.YddAdvimg;
import com.itheima.advantagesup.vo.AdvImgVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface yddAdvimgMapper {

    @Insert("insert into ydd_advimg (advimgpos,advimgsrc,advimgdesc,advimglink) " +
            "values (#{advimgpos},#{advimgsrc},#{advimgdesc},#{advimglink})")
    void caeate(AdvImgCreateDTO advImgCreateDTO);

    @Delete("delete from ydd_advimg where id = #{id}")
    void deleteById(Integer id);

    AdvImgCreateDTO select(String id);

    Page<YddAdvimg> selectPage(YddAdvimg yddAdvimg);

    void update(YddAdvimg yddAdvimg);

    List<AdvImgVO> selectByPosId(int i);
}
